package design.mode.model.strategy.strategy;

import design.mode.model.strategy.annotation.Business;
import design.mode.model.strategy.strategy.bean.SystemBean;
import design.mode.model.strategy.biz.AbstractBiz;
import design.mode.model.strategy.busenum.BusinessTypeEnum;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Business(BusinessTypeEnum.SYS_MSG_002)
public class SysProcessStrategy  extends AbstractBiz<SystemBean> {


    @Override
    public SystemBean buildBean(Map<String, Object> paramMap) {
        SystemBean systemBean = new SystemBean();
        try {
            BeanUtils.copyProperties(systemBean,paramMap);
        } catch (Exception e) {
            System.out.println("注入属性失败");
        }
        return systemBean;
    }

    @Override
    public Object callBiz(SystemBean systemBean) {
        System.out.println("执行SysProcessStrategy的callBi方法");
        return "执行SysProcessStrategy的callBi方法";
    }
}